Repository navigation
csnode: bootstrap tables of 9 to 25 confidants, official weights up to 8 - #70
Merged
Merged
Conversation
Node::calculateBootStrapWeight could only weigh tables of up to 8 confidants, so a network of 9 or more initial confidants never bootstrapped (testnet, 9 nodes: sequence 0 for 45 min). cs::bootstrapWeight (csnode/bootstrapweight.hpp) replaces it: up to 8 keys it gives exactly the official values on x86-64, so community and official nodes choose the same table; from 9 to 25 keys (MaxTrustedNodes) it weighs well-formed tables of initial confidants, a larger one above a smaller one. 32-bit weight, no undefined behaviour in the loop, signed tables above unsigned ones. "Bootstrap on" logs the table's size and weight, and a table that is not taken is logged. Unit tests compare it with the official loop on every table of up to 8 keys. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
EnzinoBB
force-pushed
the
fix/bootstrap-weight
branch
from
October 22, 2026 12:54
6524e16 to
ce2a751
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Node::calculateBootStrapWeightcan only weigh bootstrap tables of up to 8 confidants. A network of 9 or more initial confidants therefore never bootstraps. In testnet run 39758454691 (9 nodes) every node stayed at sequence 0 for 45 minutes. This is an upstream issue; mainnet (7 default confidants) is not affected as configured today.Change
cs::bootstrapWeight(csnode/include/csnode/bootstrapweight.hpp) replaces the calculation.MaxTrustedNodes): well-formed tables of initial confidants are weighed, and a larger table weighs more than a smaller one.Bootstrap onlogs the table's size and weight, and a table that is not taken is logged.Tests
Validation
node_alt_ref=master, so the even nodes run the official weight): PASS.🤖 Generated with Claude Code